package com.chiffoyqc.controller;

import com.alibaba.fastjson.JSON;
import com.chiffoyqc.service.MeterAddService;
import com.chiffoyqc.service.MeterDeleteService;
import com.chiffoyqc.utils.HttpHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/12.
 * 7.5. 表具移除
 */
@Controller
public class MeterDeleteController {
    @Autowired
    private MeterDeleteService meterDeleteService;

    @RequestMapping("/v1/meter/meterdelete")
    public void meterDelete(HttpServletRequest request, HttpServletResponse response){
        String postData = HttpHelper.getPostData(request);

        Map<String, Object> map = meterDeleteService.handleRequestMessage(postData);
        if(map != null){
            Object o = JSON.toJSON(map);
            HttpHelper.responseDataForRMIS(response,o);
        }

    }
}
